#ifndef COMMONFILE
#define COMMONFILE

#include <iostream>
#include <fstream>
#include <string>
#include "CommonString.h"

class CommonFile
{
public:
	CommonFile( const CommonString& _fileName ) { mStream.open(_fileName.GetStdString().c_str()); }
	~CommonFile() { if (mStream.is_open())  mStream.close(); }

	bool IsOpen() { return mStream.is_open(); }
	bool GetLine(CommonString& aStr) { getline(mStream, aStr.GetStdString()); return !mStream.eof(); }

private:
	std::fstream mStream;
};

#endif
